登录 白背景

leetcode/832翻转图像.md

https://leetcode-cn.com/problems/flipping-an-image/

func flipAndInvertImage(A [][]int) [][]int {
    ret := make([][]int,len(A))
    for i := 0; i < len(A); i++ {
        ret[i] = make([]int, len(A[i]))
        for o := 0; o < len(A[i]); o++ {
            ret[i][o] = A[i][len(A[i]) - o - 1] ^ 1
        }
    }
    return ret
}